package com.nlx.notes.module.controller.user;

import com.nlx.notes.module.service.user.IUserUniqueCodeRelService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author nlx
 * @since 2025-08-16
 */
@Slf4j
@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserUniqueCodeRelController {

    final IUserUniqueCodeRelService userUniqueCodeRelService;


    @GetMapping(value = "/v1/user-code")
    public String userCode(@RequestParam(value = "deviceCode") String deviceCode){
        log.info("获取用户的唯一标识，客户端标识 -> {}", deviceCode);
        return userUniqueCodeRelService.findUserCode(deviceCode);
    }


}
